<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:oui="clr-namespace:OpenLS.UI"
                    xmlns:ouit="clr-namespace:OpenLS.UI.Themes;assembly="
                    x:Class="OpenLS.UI.VistaOfficeWindowResources"
    >
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source ="vistaConverter.xaml"/>
        <ouit:ApplicationMenuResources/>
    </ResourceDictionary.MergedDictionaries>
  <ControlTemplate TargetType ="{x:Type oui:RibbonWindow}" x:Key="vistaOfficeWindowTemplate">
    <Grid Name="PART_MainGrid" >
        <Grid Loaded="OnGridLoaded" Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource c1}}">
          <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="60"/>
          </Grid.ColumnDefinitions>
          <Rectangle Grid.Row="1" Grid.RowSpan ="2" Fill="{TemplateBinding Background}"  Grid.ColumnSpan="4"/>
                <AdornerDecorator Grid.Row ="2" Grid.ColumnSpan="4">
                    <ContentPresenter Grid.Row ="2" ContentSource="Content" Grid.ColumnSpan="4"/>
                    </AdornerDecorator>
          <ContentPresenter Grid.Row ="1" ContentSource="Ribbon" Grid.RowSpan="1" Grid.ColumnSpan="4" />

        </Grid>
      <Grid >
        <Grid.RowDefinitions>
          <RowDefinition Height="24"/>
          <RowDefinition Height="26"/>
          <RowDefinition Height="0"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="60"/>
        </Grid.ColumnDefinitions>
        <Label Content="{TemplateBinding Title}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Name="titleBar"
        Loaded="OnLabelLoaded" PreviewMouseDoubleClick="OnLabelMouseDoubleClick"
        MouseDown="OnLabelMouseDown" Grid.Column="2"
               Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}">
          <Label.BitmapEffect>
            <OuterGlowBitmapEffect GlowColor ="White" GlowSize="10" Opacity="1" Noise="0"/>
          </Label.BitmapEffect>
        </Label>
        <!--<ContentPresenter ContentSource="ApplicationMenu"  Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.RowSpan="2"/>-->
        <ContentPresenter ContentSource="ApplicationMenu" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="1"/>
        <ContentPresenter ContentSource="QuickAccessToolbar" VerticalAlignment="Center" Grid.Column="1" Margin="0 4 0 0"/>
                <Image Source="{TemplateBinding Icon}" Width="16" Height="16" HorizontalAlignment="Left"   VerticalAlignment="Center"></Image>


            </Grid>
    </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property ="WindowState" Value="Maximized">
                <Setter Property="Foreground" Value="White" TargetName="titleBar"/>
                <Setter Property="BitmapEffect" Value="{x:Null}" TargetName="titleBar"/>
                <Setter Property="Margin" Value="0 4 0 0" TargetName="PART_MainGrid"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

</ResourceDictionary>